import request from "@/utils/request";

export const getGoodsList = () =>
    request({
        url: "/goods/getGoodsList",
        method: "GET",
    });

export const deleteGoods = (gid) =>
    request({
        url: `/goods/deleteGoods/${gid}`,
        method: "DELETE"
    })

export const addGoods = (data) =>
    request({
        url: "/goods/addGoods",
        method: "POST",
        data,
    })

export const updateGoods = (goods) =>
    request({
        url: "/goods/updateGoods",
        method: "PUT",
        data: goods,
    });

export const goodsDetail = (gid) =>
    request({
        url: `/goods/getGoodsDetail/${gid}`,
        method: "GET",
    })

export const getGoodsByInfo = (info) =>
    request({
        url: `/goods/getGoodsByInfo?info=${info}`,
        method: "GET",
    })